Skip to content

Conversation

lcian
Copy link
Member

@lcian lcian commented Aug 1, 2025

Introduces a new function default_event_filter_with_logs which is the same as the default one but also sends logs for anything at or above INFO.

If the sentry crate is used with the logs feature and there's already a Hub active, grab enable_logs from the associated client and use the new default filter with logs if possible.
If there's no hub, still use the new function that creates logs.
If enable_logs: false, the client will drop the logs later anyways.

Users still need to opt into sending logs by enabling the feature flag and setting enable_logs: true, but this makes it easier if you don't want to set up a custom event filter, and it also makes the onboarding docs simpler.

Close #871

Copy link

github-actions bot commented Aug 1, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 84f99ca

Copy link

codecov bot commented Aug 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.39%. Comparing base (a5932c0) to head (84f99ca).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #878      +/-   ##
==========================================
+ Coverage   73.33%   73.39%   +0.05%     
==========================================
  Files          64       64              
  Lines        7423     7423              
==========================================
+ Hits         5444     5448       +4     
+ Misses       1979     1975       -4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lcian
Copy link
Member Author

lcian commented Aug 25, 2025

One might initialize the tracing layer before initializing the SDK, in which case this will not work.
This means that reordering the calls could lead to an unexpected change in behavior.
Therefore, I don't think this should be introduced.

@lcian lcian closed this Aug 25, 2025
@lcian lcian reopened this Sep 11, 2025
@lcian lcian marked this pull request as ready for review September 11, 2025 12:43
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@lcian lcian merged commit 045c2e2 into master Sep 11, 2025
19 checks passed
@lcian lcian deleted the lcian/feat/tracing-logs-by-default branch September 11, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In sentry-tracing, enable EventFilter::Log by default when enable_logs: true
2 participants